<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@taglib prefix="s" uri="strutsTags"%>
<script type="text/javascript" src="dwr/interface/MYLR.js"></script>
<div id="dlgLeaveTotal" style="display: none; width: 600px">
	<table id="table3" cellSpacing="0" cellPadding="0" width="100%"
		class="gridview" id="logTable">
		<tr id="leaveTotalTitle">
			<td class="tablefield" align="center">
				休假种类
			</td>
			<td class="tablefield" align="center">
				本年已用额度(
				<span type="dayHourShow">天</span>)
			</td>
			<td class="tablefield" align="center">
				本年可用额度(
				<span type="dayHourShow">天</span>)
			</td>
			<td class="tablefield" align="center">
				待审(
				<span type="dayHourShow">天</span>)
			</td>
			<td class="tablefield" align="center">
				本年额度(
				<span type="dayHourShow">天</span>)
			</td>
		</tr>
		<s:iterator value="lrTypeList">
			<tr>
				<td class="tablefield" align="center"
					id="<s:property value="ltNo"/>_type"></td>
				<td align="center" id="<s:property value="ltNo"/>_totaldays"></td>
				<td align="center" id="<s:property value="ltNo"/>_canUseTotals"></td>
				<td align="center" id="<s:property value="ltNo"/>_toApproveDays"></td>
				<td align="center" id="<s:property value="ltNo"/>_useTotals"></td>
			</tr>
		</s:iterator>
		<tr>
			<td align="center" colspan="5">
				<input class="button" type="button" value="关闭"
					onclick="hrm.common.closeDialog('dlgLeaveTotal');" />
			</td>
		</tr>
	</table>
</div>
<script type="text/javascript">
	hrm.common.initDialog('dlgLeaveTotal');

	function getLeaveTotal(empId, dayOrHour, actionURL) {
		MYLR.getLeaveTotal(empId, dayOrHour, actionURL, leaveTotalCallback);
	}

	function leaveTotalCallback(result) {
		if (result.error != null) {
			alert(result.error);
			return;
		}
		for ( var i = 0; i < result.param_succ.length; i++) {
			var bean = result.param_succ[i];
			var id = bean.id;
			document.getElementById(id + "_type").innerHTML = bean.type;
			document.getElementById(id + "_totaldays").innerHTML = bean.totaldays;
			document.getElementById(id + "_toApproveDays").innerHTML = bean.toApproveDays;
			document.getElementById(id + "_canUseTotals").innerHTML = bean.canUseTotals;
			document.getElementById(id + "_useTotals").innerHTML = bean.useTotals;
		}
		var empName = document.getElementById("empName").value;
		var currYear = document.getElementById("currYear").value;
		hrm.common.openDialog('dlgLeaveTotal', null, '年度请假汇总(' + empName + '-'
				+ currYear + ')');
	}
</script>
